import {createRouter, createWebHistory} from "vue-router";

const routes = [{
    path: '/',
    redirect: '/login',
    name: 'welcome'
}, {
    path: '/login',
    name: 'Login',
    component: _ => import('../../views/Login.vue')
}, {
    path: '/manage',
    name: 'Manage',
    component: _ => import('../../views/Manage.vue'),
    children: [{
        path: '/tower',
        name: 'Tower',
        component: _ => import('../../views/tower/Tower.vue'),
    },{
        path: '/user',
        name: 'User',
        component: _ => import('../../views/user/User.vue'),
    },{
        path: '/role',
        name: 'Role',
        component: _ => import('../../views/role/Role.vue'),
    }]
}]

const router = createRouter({
    routes: routes,
    history: createWebHistory() //这里如果使用webHashHistory，路由跳转可能会出问题
});

export default router;
